// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期：2024-04-24 15:48:40
// 生成路径: internal/app/business/controller/performances.go
// 生成人：周志雄
// desc:演出节目
// company:云南奇讯科技有限公司
// ==========================================================================

package controller

import (
	"context"
	"github.com/tiger1103/gfast/v3/api/v1/business"
	"github.com/tiger1103/gfast/v3/internal/app/business/service"
	systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
	"github.com/tiger1103/gfast/v3/library/liberr"
)

type performancesController struct {
	systemController.BaseController
}

var Performances = new(performancesController)

// List 列表
func (c *performancesController) List(ctx context.Context, req *business.PerformancesSearchReq) (res *business.PerformancesSearchRes, err error) {
	res, err = service.Performances().List(ctx, req)
	return
}

// Get 获取演出节目
func (c *performancesController) Get(ctx context.Context, req *business.PerformancesGetReq) (res *business.PerformancesGetRes, err error) {
	res = new(business.PerformancesGetRes)
	res.PerformancesInfoRes, err = service.Performances().GetById(ctx, req.Id)
	return
}

// Add 添加演出节目
func (c *performancesController) Add(ctx context.Context, req *business.PerformancesAddReq) (res *business.PerformancesAddRes, err error) {
	err = service.Performances().Add(ctx, req)
	return
}

//// Edit 修改演出节目
//func (c *performancesController) Edit(ctx context.Context, req *business.PerformancesEditReq) (res *business.PerformancesEditRes, err error) {
//	err = service.Performances().Edit(ctx, req)
//	return
//}
//
//// Delete 删除演出节目
//func (c *performancesController) Delete(ctx context.Context, req *business.PerformancesDeleteReq) (res *business.PerformancesDeleteRes, err error) {
//	err = service.Performances().Delete(ctx, req.Ids)
//	return
//}

// 获取演出节目座位实时
func (c *performancesController) SeatSummary(ctx context.Context, req *business.PerformancesSeatStaticInfoReq) (res *business.PerformancesSeatStaticInfoRes, err error) {
	res = new(business.PerformancesSeatStaticInfoRes)
	summary, err := service.Seats().GetSeatsStaticInfo(ctx, req.PerformanceId)
	liberr.ErrIsNil(ctx, err, "获取演出节目座位实时数据失败")
	res.List = summary
	return
}
